<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%user}}".
 *
 * @property integer $id
 * @property string $username
 * @property string $icon
 * @property integer $sex
 * @property string $phone
 * @property string $signature
 * @property integer $age
 * @property integer $emotional
 * @property string $hometown
 * @property string $professional
 * @property integer $start
 * @property integer $carId
 * @property integer $userCardImg
 * @property integer $realStart
 * @property double $userMoney
 * @property string $access_token
 * @property integer $cid
 * @property integer $is_anchor
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username'], 'required'],
            [['sex', 'age', 'emotional', 'start', 'carId', 'userCardImg', 'realStart', 'cid', 'is_anchor'], 'integer'],
            [['userMoney'], 'number'],
            [['username', 'hometown', 'professional'], 'string', 'max' => 32],
            [['icon', 'signature'], 'string', 'max' => 322],
            [['phone'], 'string', 'max' => 20],
            [['access_token'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => '用户名',
            'icon' => '用户头像',
            'sex' => '性别',
            'phone' => '手机号',
            'signature' => '个性签名',
            'age' => '年龄',
            'emotional' => '情感状态',
            'hometown' => '家乡',
            'professional' => '职业',
            'start' => '状态',
            'carId' => '身份证号码',
            'userCardImg' => '证件照片',
            'realStart' => '是否是实名认证',
            'userMoney' => '余额',
            'access_token' => '权限认证',
            'cid' => '分类id',
            'is_anchor' => '是否是主播',
        ];
    }
}
